import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/components/login/login'
import Home from '@/components/Home/home'
import shou from '@/components/Home/shou'
import shopgl from '@/components/shop/shopgl'
import leishop from '@/components/shop/leishop'
import userList from '@/components/user/userList'
import order from '@/components/order/order'
import detail from '@/components/order/detail'
import addshop from '@/components/shop/addshop'
import shopList from '@/components/shop/shopList'
import bian from '@/components/shop/bianji'
import echar from '@/components/table/echars'
import baidu from '@/components/table/baidu'
import add from '@/components/shop/addlei'
Vue.use(Router)

export default new Router({
  routes: [{
      path: '/login',
      name: 'Login',
      component: Login,
      meta: {
        title: "登录系统"
      }
    },
    {
      path: '/',
      name: 'Home',
      component: Home,
      meta: {
        requireAuth: true,
        title: "系统首页"
      },
      children: [{
          path: "/shou",
          name: "shou",
          component: shou,
          meta: {
            requireAuth: true,
            title: "系统首页"
          }
        },
        {
          path: "/leishop",
          name: "leishop",
          component: leishop,
          meta: {
            requireAuth: true,
            title: "品类管理"
          }
        },
        {
          path: "/shopgl",
          name: "shopgl",
          component: shopgl,
          meta: {
            requireAuth: true,
            title: "商品管理"
          }
        },
        {
          path: "/order",
          name: "order",
          component: order,
          meta: {
            requireAuth: true,
            title: "订单列表"
          }
        },
        {
          path: "/userList",
          name: "userList",
          component: userList,
          meta: {
            requireAuth: true,
            title: "用户列表"
          }
        },
        {
          path: "/detail",
          name: "detail",
          component: detail,
          meta: {
            requireAuth: true,
            title: "查看订单"
          }
        },
        {
          path: "/addshop",
          name: "addshop",
          component: addshop,
          meta: {
            requireAuth: true,
            title: "添加商品"
          }
        },
        {
          path: "/shopList",
          name: "shopList",
          component: shopList,
          meta: {
            requireAuth: true,
            title: "商品详情"
          }
        },
        {
          path: "/bian",
          name: "bian",
          component: bian,
          meta: {
            requireAuth: true,
            title: "修改商品"
          }
        },
        {
          path: "/echar",
          name: "echar",
          component: echar,
          meta: {
            requireAuth: true,
            title: "echars图表"
          }
        },
        {
          path: "/baidu",
          name: "baidu",
          component: baidu,
          meta: {
            requireAuth: true,
            title: "百度地图"
          }
        },
        {
          path: "/add",
          name: "add",
          component: add,
          meta: {
            requireAuth: true,
            title: "添加品类"
          }
        },


      ],
      redirect: "/shou"
    },
  ]
})
